package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.SensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("api/v1/sensitive")
public class SensitiveController {
    @Autowired
    private SensitiveService sensitiveService;
    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmSensitive wmSensitive){
        return  sensitiveService.insert(wmSensitive);

    }
    @PostMapping("/list")
    public ResponseResult list(@RequestBody SensitiveDto dto){
        return  sensitiveService.list(dto);
}

    @PostMapping("/update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive){
        return sensitiveService.update(wmSensitive);

    }
    @DeleteMapping("/del/{id}")
    public ResponseResult delete (@RequestParam ("id") Integer id){
        return  null;
    }



}
